<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function some(arr, a) {
            let flag = false//必须得先申明这个变量是false，否则放在里面就会一直运行
            for (let i = 0; i < arr.length; i++) {
                if (a === arr[i]) {
                    flag = true
                    break
                }

            }
            return flag
        }
        console.log(some([1, 2, 3], 3));
    </script>
</body>

</html>